<div class="row">
<div class="panel callout"><h6>Add Lesson</h6></div>

	<?if(isset($system_message))echo $system_message;?>
	<?php echo validation_errors() == '' ? NULL : '<div class="error">'.validation_errors().'</div>';?>
	
	<?require('navigation/lesson_nav.php');?>
	
	<form action="<?=site_url(array('teacher','add_lesson'))?>" method="post" class="custom submit_forms" enctype="multipart/form-data" accept-charset="utf-8">
		<div class="panel"><input type="text" name="lesson[lesson_title]" value="" style="font-size:large;" placeholder="Lesson Title"></div>
		
		<div class="row">
			<div class="large-12 columns">
				<label>Grading Period</label>
				<?if(!empty($period)):?>
					<select name="lesson[gp_id]">
						<?foreach($period AS $p => $val):?>
							<option value="<?=$val['value']?>"><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				<?else:?>
					<div data-alert class="alert-box secondary">Error retrieving Grading Periods.</div>
				<?endif;?>
			</div>
		</div>
		
		<div class="row">
			<div class="large-6 columns">
				<label>Grade Level</label>
				<?if(!empty($level)):?>
					<select name="lesson[lvl_id]">
						<?foreach($level AS $l => $val):?>
							<option value="<?=$val['value']?>"><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				<?else:?>
					<div data-alert class="alert-box secondary">Error retrieving Grade Levels.</div>
				<?endif;?>
			</div>
			
			<div class="large-6 columns">
				<label>Section</label>
				<?if(!empty($section)):?>
					<select name="lesson[section_id]">
						<?foreach($section AS $s => $val):?>
							<option value="<?=$val['value']?>"><?=ucwords($val['title'])?></option>
						<?endforeach;?>
					</select>
				<?else:?>
					<div data-alert class="alert-box secondary">Error retrieving Sections.</div>
				<?endif;?>
			</div>
		</div>
		
		<div class="row">
			<div class="large-12 columns">
				<label>Subject</label>
				<?if(!empty($subject)):?>
					<select name="lesson[sbj_id]">
						<?foreach($subject AS $s => $val):?>
							<option value="<?=$val['value']?>"><?=ucwords($val['title']);?></option>
						<?endforeach;?>
					</select>
				<?else:?>
					<div data-alert class="alert-box secondary">Error retrieving Subjects.</div>
				<?endif;?>
			</div>
		</div>
		
		<div class="row">
			<div class="large-12 columns">
			  <label>Lesson Description</label>
			  <textarea name="lesson[lesson_desc]" style="min-height:100px;max-height:100px;"><?php echo set_value('lesson_desc');?></textarea>
			</div>
		</div>
		
		<div class="row">
			<div class="large-12 columns">
				<label>File Attachment</label>
			</div>
		</div>
		<fieldset>
			<div class="alert-box secondary">Allowed formats: -.doc, -.docx, -.txt, -.jpg</div>
			<input type="file" name="userfile">
		</fieldset>
		
		<a href="#" class="button small success submit_btns">Add Lesson</a>
	</form>
</div>